package com.working.user.init

import android.content.Context
import androidx.navigation.fragment.fragment
import androidx.startup.Initializer
import com.alibaba.android.arouter.launcher.ARouter
import com.working.libbase.initializer.AppInitializer
import com.working.libbase.initializer.ApplicationProvider
import com.working.user.R
import com.working.user.main.UserFragment

class ModuleInitializer : Initializer<Unit> {
    override fun create(context: Context) {
        val applicationProvider = ARouter.getInstance().navigation(ApplicationProvider::class.java)
        applicationProvider.addDestination {
            this.fragment<UserFragment>(R.id.tab_user)
        }
        applicationProvider.addMenu {
            add(0, R.id.tab_user, 3, "我的").setIcon(R.drawable.user_ic_action_user)
        }
    }

    override fun dependencies(): MutableList<Class<out Initializer<*>>> =
        mutableListOf(AppInitializer::class.java)
}